package com.h3c.ptability.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.h3c.ptability.bo.DeptManagerBO;
import com.h3c.ptability.bo.SearchDeptsManagersBO;
import com.h3c.ptability.dto.OptionsDTO;
import com.h3c.ptability.dto.PtDeptDTO;
import com.h3c.ptability.dto.eos.EosSpecialDeptDto;
import com.h3c.ptability.entity.PtDept;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.List;

/**
 * Copyright (C), 2020-2020, h3c
 * FileName: IPtDeptService
 *
 * @Author: l22886
 * @Date: 2022-03-14
 * Description: pt_dept service
 * Version: 1.0
 */
public interface IPtDeptService extends IService<PtDept> {

    /**
     * @title: selectFuzzyByDto
     * @description: 模糊查询操作
     * @params: [ dto ]
     * @return: java.util.List
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public List<PtDeptDTO> selectFuzzyByDto(PtDeptDTO dto);

    /**
     * @title: selectByDto
     * @description: 精确查询操作
     * @params: [ dto ]
     * @return: java.util.List
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public List<PtDeptDTO> selectByDto(PtDeptDTO dto);

    /**
     * @title: insertDto
     * @description: 插入操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public Integer insertDto(PtDeptDTO dto);

    /**
     * @title: updateDto
     * @description: 修改操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public Integer updateDto(PtDeptDTO dto);

    /**
     * @title: deleteDto
     * @description: 删除操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-03-14
     * @version: 1.0
     * @author: l22886
     */
    public Integer deleteDto(PtDeptDTO dto);

    public void syncPtDept(Boolean flag);

    List<PtDeptDTO> qyeryChidrenDeptList(PtDeptDTO ptDeptDTO);

    /**
     * 设置部门相关人员
     *
     * @param ptDeptDTO
     * @return
     */
    void setDeptUserRole(PtDeptDTO ptDeptDTO, String domain);

    /**
     * 导入部门信息
     *
     * @param appId 应用id
     * @param file  文件
     */
    void importDeptSetList(String appId, MultipartFile file);

    /**
     * 导入部门体系信息
     * @param file
     */
    void importDeptSystemSet(MultipartFile file);

    List<OptionsDTO> queryDeptTreeSelection(String deptIds);

    List<DeptManagerBO> getDeptsManagers(SearchDeptsManagersBO searchDeptsManagersBO);

    List<PtDeptDTO> getAuthorizeDeptTree(PtDeptDTO ptDeptDTO, String domain);

    PtDeptDTO getAuthorizeChildTree(String appId, String workerId);

    List<PtDeptDTO> changeRootToChildList(PtDeptDTO root);

    List<PtDeptDTO> getAllAuthorizedDeptList(String appId, String domain);

    /**
     * 获取特殊部门集合
     * @return 特殊部门集合
     */
    List<EosSpecialDeptDto> getSpecialDeptCodesFromEos();
}
